package edu.zut.bailan.score.domain;

import edu.zut.bailan.base.domain.BaseTreeEntity;

import javax.persistence.*;
import java.util.List;
@Entity
@Table(name = "T_PRODUCT_CATEGORY")
//@NamedQueries({ @NamedQuery(name = "ProductCategory.getRoot", query = "select m from ProductCategory m where m.parent is null") })
public class ScoreCategory extends BaseTreeEntity<ScoreCategory, Long> {

    /**
     *
     */
    private static final long serialVersionUID = 4332664714675716388L;

    /**
     * code for score category
     */
    @Column
    String code;

    /**
     * name for score category
     */
    @Column
    String name;

    /**
     *
     */
    @OneToMany(mappedBy = "scoreCategory", cascade = CascadeType.REMOVE, fetch = FetchType.EAGER)
    List<Score> scores;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }
}
